﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using LogisticsBLL;
using Model;

namespace WebLosgic.CapacityTruck
{
    public partial class SelectTruck : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }


        public void ddlType()
        {
            CarrierBLL car = new CarrierBLL();
            ddlTruckType.DataSource = car.ddlType();
            ddlTruckType.DataTextField = "Type";
            ddlTruckType.DataValueField = "Type";
            ddlTruckType.DataBind();
            ddlTruckType.Items.Insert(0, new ListItem("--全部--", " "));
        }

        protected void AspNetPagerTool_PageChanged(object sender, EventArgs e)
        {

        }

        protected void Btnselect_Click(object sender, EventArgs e)
        {
            CarrierBLL car = new CarrierBLL();
            Trucks tus = new Trucks();
            
            tus.Number = TxtNumber.Text;
            tus.State = Convert.ToInt32(ddlState.SelectedValue);
            tus.Type = ddlTruckType.SelectedValue;
            tus.pageIndex = AspNetPagerTool.CurrentPageIndex;
            tus.pageSize = AspNetPagerTool.PageSize;
            int recout = 0;
            List<Trucks> tru = car.Bindtruck(tus, out recout);
            RptBindDrive.DataSource = tru;
            AspNetPagerTool.RecordCount = recout;
            RptBindDrive.DataBind();
        }
    }
}